import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

/**
 * @ClassName Demo02_ObjectInputStream
 * @Description TODO
 * @Author Li
 * @Date 2022/8/12 21:07
 * @ModifyDate 2022/8/12 21:07
 * @Version 1.0
 */
public class Demo02_ObjectInputStream {
    public static void main(String[] args) {
        Student student = null;
        try {
            // 创建反序列化流
            FileInputStream fis = new FileInputStream("src/part10/ch03_Serializable/student.txt");
            ObjectInputStream ois = new ObjectInputStream(fis);
            // 读取对象
            Object o1 = ois.readObject();
            System.out.println(o1);
            ois.close();
            fis.close();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
}
